impl Solution {
    pub fn missing_number( mut nums: Vec<i32>) -> i32 {
        let n =nums.len() as i32;
        let mut i=0;
        while i <nums.len(){
            if nums[i]==n{
                i+=1;
                continue;
            }else{
                if nums[i]!=i as i32{
                    let t=nums[i];
                    nums[i]=nums[t as usize];
                    nums[t as usize]=t;
                }else{
                 i+=1;
            }
            }
           
        }
        for i in 0..nums.len(){
            if nums[i]!=i as i32{
                return i as i32;
            }
        }
        return n;
    }
}